{{template "header"}}
<title>首页 - 我的 beego 博客</title>
</head>

<body>
	<div class="container" style="width: 500px">
		<form method="POST" action="/login">
			<div class="form-group">
				<label>账号</label>
				<input id="uname" class="form-control" placeholder="输入账号" name="uname">
			</div>
			<div class="form-group">
				<label>密码</label>
				<input id="pwd" type="Password" class="form-control" placeholder="密码" name="pwd">
			</div>
			<div class="checkbox">
				<label>
					<input type="checkbox" name="autoLogin">自动登陆
				</label>
			</div>
			<button type="submit" class="btn btn-default" onclick="return checkInput();">登陆</button>
			<button class="btn btn-default" onclick="return backToHome();">返回</button>
		</form>

		<script type="text/javascript">
			function checkInput() {
				if (document.getElementById("uname").value.length == 0) {
					alert("请输入账号");
					return false
				}
				if (document.getElementById("pwd").value.length == 0) {
					alert("请输入密码");
					return false
				}
				return true
			}
			function backToHome() {
				window.location.href = "/"
				return false
			}

		</script>
	</div>
</body>

</html>